home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Orpheus v3.02 / SETUP.EXE / %MAINDIR% / OvcDbHIs.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-02-25  |  5.1 KB  |  143 lines

  1. {*********************************************************}
  2. {*                   OVCDBHIS.PAS 3.00                   *}
  3. {*     Copyright 1995-99 (c) TurboPower Software Co      *}
  4. {*                 All rights reserved.                  *}
  5. {*********************************************************}
  6.  
  7. {$I OVC.INC}
  8.  
  9. {$IFNDEF VERSION3}
  10. !! Error - The DBISAM engine helper class is for Delphi 3+ only
  11. {$ENDIF}
  12.  
  13. {$B-} {Complete Boolean Evaluation}
  14. {$I+} {Input/Output-Checking}
  15. {$P+} {Open Parameters}
  16. {$T-} {Typed @ Operator}
  17. {$W-} {Windows Stack Frame}
  18. {$X+} {Extended Syntax}
  19.  
  20. {$IFNDEF Win32}
  21. {$G+} {286 Instructions}
  22. {$N+} {Numeric Coprocessor}
  23.  
  24. {$C MOVEABLE,DEMANDLOAD,DISCARDABLE}
  25. {$ENDIF}
  26.  
  27. unit OvcDbHIs;
  28.   {DBISAM database engine helper class}
  29.  
  30. {Notes: DBISAM is a database engine by Extended Systems.
  31.           http://www.elevatesoft.com/
  32.         DBISAM does not support aliases, hence all alias name support
  33.         is defaulted to the ancestor.}
  34.  
  35. interface
  36.  
  37. uses
  38.   {$IFDEF Win32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF}
  39.   Messages, SysUtils, Classes,
  40.   OvcBase, Db, DBISAMTb, OvcDbHLL;
  41.  
  42. type
  43.   TOvcDbDBISAMEngineHelper = class(TOvcDbEngineHelperBase)
  44.   {.Z+}
  45.   protected {private}
  46.   protected
  47.   public
  48.   {.Z-}
  49.     {===GENERAL TABLE AND INDEX-BASED METHODS===}
  50.     procedure FindNearestKey(aDataSet   : TDataSet;
  51.                        const aKeyValues : array of const); override;
  52.       {-position the dataset on the nearest record that matches the
  53.         passed key}
  54.     function GetIndexDefs(aDataSet : TDataSet) : TIndexDefs; override;
  55.       {-return the index definitions for the given dataset}
  56.     function GetIndexField(aDataSet    : TDataSet;
  57.                            aFieldIndex : integer) : TField; override;
  58.       {-return the TField object for the given field number in the
  59.         current index.}
  60.     function GetIndexFieldCount(aDataSet : TDataSet) : integer; override;
  61.       {-return the number of fields in the key for the current index.}
  62.     procedure GetIndexFieldNames(aDataSet         : TDataSet;
  63.                              var aIndexFieldNames : string); override;
  64.       {-return the field names for the current index for the given
  65.         dataset}
  66.     procedure GetIndexName(aDataSet   : TDataSet;
  67.                        var aIndexName : string); override;
  68.       {-return the name of the current index for the given dataset}
  69.     function IsChildDataSet(aDataSet : TDataSet) : boolean; override;
  70.       {-return whether the dataset is the detail part of a
  71.         master/detail relationship (ie, the current index is 'locked'
  72.         to the master dataset)}
  73.  
  74.     procedure SetIndexFieldNames(aDataSet         : TDataSet;
  75.                            const aIndexFieldNames : string); override;
  76.       {-set the current index to that containing the given fields for
  77.         the given dataset}
  78.     procedure SetIndexName(aDataSet   : TDataSet;
  79.                      const aIndexName : string); override;
  80.       {-set the current index to the given name for the given dataset}
  81.  
  82.   end;
  83.  
  84.  
  85. implementation
  86.  
  87.  
  88. {===TOvcDbDBISAMEngineHelper=========================================}
  89. procedure TOvcDbDBISAMEngineHelper.FindNearestKey(aDataSet   : TDataSet;
  90.                                             const aKeyValues : array of const);
  91. begin
  92.   (aDataSet as TDBISAMTable).FindNearest(aKeyValues);
  93. end;
  94. {--------}
  95. function TOvcDbDBISAMEngineHelper.GetIndexDefs(aDataSet : TDataSet) : TIndexDefs;
  96. begin
  97.   Result := (aDataSet as TDBISAMTable).IndexDefs;
  98. end;
  99. {--------}
  100. function TOvcDbDBISAMEngineHelper.GetIndexField(aDataSet    : TDataSet;
  101.                                                 aFieldIndex : integer) : TField;
  102. begin
  103.   Result := (aDataSet as TDBISAMTable).IndexFields[aFieldIndex];
  104. end;
  105. {--------}
  106. function TOvcDbDBISAMEngineHelper.GetIndexFieldCount(aDataSet : TDataSet) : integer;
  107. begin
  108.   Result := (aDataSet as TDBISAMTable).IndexFieldCount;
  109. end;
  110. {--------}
  111. procedure TOvcDbDBISAMEngineHelper.GetIndexFieldNames(aDataSet         : TDataSet;
  112.                                                   var aIndexFieldNames : string);
  113. begin
  114.   aIndexFieldNames := (aDataSet as TDBISAMTable).IndexFieldNames;
  115. end;
  116. {--------}
  117. procedure TOvcDbDBISAMEngineHelper.GetIndexName(aDataSet   : TDataSet;
  118.                                             var aIndexName : string);
  119. begin
  120.   aIndexName := (aDataSet as TDBISAMTable).IndexName;
  121. end;
  122. {--------}
  123. function TOvcDbDBISAMEngineHelper.IsChildDataSet(aDataSet : TDataSet) : boolean;
  124. begin
  125.   Result := (aDataSet as TDBISAMTable).MasterSource <> nil;
  126. end;
  127. {--------}
  128. procedure TOvcDbDBISAMEngineHelper.SetIndexFieldNames(aDataSet         : TDataSet;
  129.                                                 const aIndexFieldNames : string);
  130. begin
  131.   (aDataSet as TDBISAMTable).IndexFieldNames := aIndexFieldNames;
  132. end;
  133. {--------}
  134. procedure TOvcDbDBISAMEngineHelper.SetIndexName(aDataSet   : TDataSet;
  135.                                           const aIndexName : string);
  136. begin
  137.   (aDataSet as TDBISAMTable).IndexName := aIndexName;
  138. end;
  139. {====================================================================}
  140.  
  141.  
  142. end.
  143.